package org.ala.tiktools.generator.mybatis.dbinfo;

/**
 * 字段信息
 *
 * @author ala
 * @date 2024-12-31 10:57
 */
public class ColumnInfo {
    protected String name;
    protected String type;
    protected String desc;
    /**
     *  是否虚拟字段
     */
    protected boolean generated;
    /**
     *  是否唯一自增主键
     */
    protected boolean onlyAutoIncrementPrimaryKey;


    public static ColumnInfo build(String name, String type, String desc, boolean generated, boolean onlyAutoIncrementPrimaryKey) {
        ColumnInfo info = new ColumnInfo();
        info.setName(name);
        info.setType(type);
        info.setDesc(desc);
        info.setGenerated(generated);
        info.setOnlyAutoIncrementPrimaryKey(onlyAutoIncrementPrimaryKey);
        return info;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public boolean isGenerated() {
        return generated;
    }

    public void setGenerated(boolean generated) {
        this.generated = generated;
    }

    public boolean isOnlyAutoIncrementPrimaryKey() {
        return onlyAutoIncrementPrimaryKey;
    }

    public void setOnlyAutoIncrementPrimaryKey(boolean onlyAutoIncrementPrimaryKey) {
        this.onlyAutoIncrementPrimaryKey = onlyAutoIncrementPrimaryKey;
    }
}
